import request from '@/utils/request'

// tree结构数据
export const getOrgizationTree = () => {
  return request({
    method: 'get',
    url: '/business-hall/tree'
  })
}
// 获取省份
export const getProvinceApi = () => {
  return request({
    method: 'get',
    url: '/areas/children'
  })
}
// 获取城市
export const getCityApi = (id) => {
  return request({
    method: 'get',
    url: '/areas/children',
    params: {
      parentId: id
    }
  })
}
// 获取机构信息
export const getOrgizationInfoApi = (id, params) => {
  return request({
    method: 'get',
    url: '/business-hall/' + id,
    params
  })
}
// 获取员工信息
export const getEmployeeInfoApi = (params) => {
  return request({
    method: 'get',
    url: '/business-hall/user/page',
    params
  })
}
// 机构作业范围
export const getMapinfoApi = (id) => {
  return request({
    method: 'get',
    url: `/business-hall/scope/${id}/1`,
    params: {
      0: id
    }
  })
}
// 编辑机构
export const editOrgizationApi = (data) => {
  return request({
    method: 'post',
    url: `/business-hall`,
    data
  })
}
// 编辑电子围栏
export const editMap = (data) => {
  return request({
    method: 'post',
    url: `/business-hall/courier/scope`,
    data
  })
}
